<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Music
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.com/license/
 * @version    $Id: manage.tpl 9747 2012-07-26 02:08:08Z john $
 * @author     Steve
 */
?>
<?php
    $this->headScript()
      ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Recorder/externals/scripts/swfobject.js');
     $this->headScript()
       ->appendFile($this->layout()->staticBaseUrl . 'externals/soundmanager/script/soundmanager2'
           . (APPLICATION_ENV == 'production' ? '-nodebug-jsmin' : '' ) . '.js')
    ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Music/externals/scripts/core.js')
    ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Music/externals/scripts/player.js')
 

?>
<div class="headline">
  <h2>
    <?php echo $this->translate('Recorder');?>
  </h2>
  <div class="tabs">
    <?php
      // Render the menu
      echo $this->navigation()
        ->menu()
        ->setContainer($this->navigation)
        ->render();
    ?>
  </div>
</div>

<script type="text/javascript">
  //<![CDATA[
    en4.core.runonce.add(function() {
      $$('#sort, #show').addEvent('change', function(){
        $(this).getParent('form').submit();
      });
    });
  //]]>
</script>

<div class='layout_right'>
  <?php echo $this->formFilter->render($this) ?>

  <?php if( count($this->quickNavigation) > 0 ): ?>
    <div class="quicklinks">
      <?php
        // Render the menu
        echo $this->navigation()
          ->menu()
          ->setContainer($this->quickNavigation)
          ->render();
      ?>
    </div>
  <?php endif; ?>
</div>

<div class='layout_middle'>
  <?php if( 0 == count($this->paginator) ): ?>

    <div class="tip">
      <span>
        <?php echo $this->translate('There is no recorder uploaded yet.') ?>
        
      </span>
    </div>

  <?php else: ?>

    <ul class="music_browse">
      <?php foreach ($this->paginator as $playlist): ?>
        <li id="music_playlist_item_<?php echo $playlist->getIdentity() ?>">
          <div class="music_browse_author_photo">
                <?php echo $this->htmlLink($playlist->getOwner(),
                     $this->itemPhoto($playlist->getOwner(), 'thumb.icon') ) ?>
            </div>
        
          <div class="music_browse_info">
            <div class="music_browse_info_title">
              <h3><?php echo $this->htmlLink($playlist->getHref(), $playlist->getTitle()) ?></h3>
            </div>
            <div class="music_browse_info_date">
              <?php echo $this->translate('Created %s by ', $this->timestamp($playlist->creation_date)) ?>
              <?php echo $this->htmlLink($playlist->getOwner(), $playlist->getOwner()->getTitle()) ?>
              -
              <?php echo $this->htmlLink($playlist->getHref(),  $this->translate(array('%s comment', '%s comments', $playlist->getCommentCount()), $this->locale()->toNumber($playlist->getCommentCount()))) ?>
            </div>
            <div class="music_browse_info_desc">
              <?php echo $playlist->description ?>
            </div>
            <?php echo $this->partial('_Player.tpl', array('recorders' => array($playlist), 'hideStats' => true)) ?>
          </div>
        </li>
      <?php endforeach; ?>
    </ul>

    <?php echo $this->paginationControl($this->paginator, null, null, array(
      'pageAsQuery' => true,
      'query' => $this->formValues,
      //'params' => $this->formValues,
    )); ?>

  <?php endif; ?>
</div>
